<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title><?php echo ($webData["title"]); ?></title>
		<link rel="shortcut icon" href=" __PUBLIC__/Imgs/bitbug_favicon.ico" />
		<link href="__PUBLIC__/Home/Css/header.css" rel="stylesheet" type="text/css" />	
	</head>
	<body>
		<div id="header_top">
<!--			<img src="__ROOT__/Uploads/thumb/th_<?php echo ($webData["logo"]); ?>" style="float:left;" width="150">-->
			<img src="__ROOT__/Uploads/thumb/st.jpg" style="float:left;" width="150">
			<form action="__APP__/Index/searchFoods" method="post">
				<input type="text" id="header_seach" name="fname">
				<input type="submit" id="header_sub" value="搜索">
			</form>

			<ul id="header_ul">
				<li><a href="__APP__/Index/index/">首页</a></li>
				<li><a href="__APP__/Bclass/index/">菜谱分类</a></li>
			</ul>
			<div id="header_login">
			<?php if(empty($_SESSION['uname'])): ?><span>
						<a href="__APP__/Login/login/" target="_blank">
							登录
						</a>
					</span>
					<span>
						<a href="__APP__/Login/reg/" target="_blank">
							注册
						</a>
					</span>
			<?php else: ?>				
				<span>
					<a href="">
					<?php echo (session('uname')); ?>
					</a>
				</span>
				<span>
					<a href="__APP__/Ucenter/index/pass">
					个人中心
					</a>
				</span>
				<span>
					<a href="__APP__/Carts/showCarts/">
					购物车
					</a>
				</span>
				<?php if(!empty($_SESSION['uMsg'])): ?><span>
					<a href="__APP__/Posts/details/form_number/<?php echo (session('uMsg')); ?>" class="clearMsg">
					新订单
					</a>
				</span><?php endif; ?>
				<span style="font-size:14px;">
					<a href="__APP__/Public/loginout/">
					退出
					</a>
				</span><?php endif; ?>
			</div>
		</div>
		<div style="clear:both;height:30px;"></div>
	</body>
</html>
<head>
	<meta charset="UTF-8">
	<title>details</title>
	<link href="__PUBLIC__/Home/Css/foods_detail.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.8.3.js"></script>

	<script type="text/javascript">
		$(function(){
			/*添加到购物车Ajax*/
			$('#addCarts').click(function(){

				var fid = $(this).attr('alt');
				var url = '__APP__/Carts/setCarts/';
				var nowobj = $(this);

				$.post(url,{id:fid},function(cdata){

					if('YES' == cdata.data){

						nowobj.text('已添加');
					}else if('NO' == cdata.data){
						nowobj.text('已存在');
					}else{
						if(!confirm('您还没有登录,去登录吗?')){
							return false;
						}
						window.location.href = "__APP__/Login/login";
					}
				});
			});

			/*删除评论*/
			$('.delEva').click(function(){

				var eid = $(this).attr('alt');
				var url = '__APP__/Foods/delEva/';
				var nowobj = $(this);

				$.post(url,{id:eid},function(cdata){

					if('YES' == cdata.data){

						nowobj.parent().parent().remove();
					}else{
						alert('删除评论失败!');
					}
				});
			});


			$('#addEva').submit(function(){
				var content = $(".evaContent").val();
				if(!content){
					alert('请输入评价内容!');
					return false;
				}
			});

		});

	</script>
</head>
<body>
<div id="detail">
	<div id="detail_left">
		<img src="__ROOT__/public/Uploads/<?php echo ($data["pic"]); ?>" width="650" style="max-height:420px;">
		<div style="width:650px;float:left;">
			<a href="__APP__/Carts/showCarts/" target="_blank">
				<div class="car">查看购物车</div>
			</a>
			<a alt="<?php echo ($data["id"]); ?>" id="addCarts" class="car">
				<div>加入购物车</div>
			</a>
        </div>
		<div style="clear:both;height:20px;"></div>
	</div>

	<div id="detail_right">

		<div id="right_top">
			<p class="pstyle">名称：
				<font style="font-size:14px;"><?php echo ($data["name"]); ?></font>
			</p>
			<p class="pstyle">价格：
				<font style="font-size:14px;">
					<?php echo ($data["price"]); ?>￥
					<font>
			</p>
			<p class="pstyle">状态：
				<font style="font-size:14px;">
					<?php if($data["status"] == 1 ): ?>在售
						<?php else: ?> 已下架<?php endif; ?>
				</font>
			</p>
			<span style="margin-left:10px;color:#68616D;">描述：</span>
			<font style="font-size:14px;text-indent:3em;color:#68616D;">
				<div style="margin:0px 10px;">
					<?php echo (substr($data["describe"],0,1000)); ?>
				</div>
			</font>
		</div>
	</div>
	</div>
</div>
</body>
</html>